From 355afc8f56c318ca8832987c905475de8375531d Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 12 Sep 2014 13:46:05 +0200 Subject: [PATCH] inspector: Show hidden windows in the inspector This allows us to access otherwise hidden windows, which can be useful to provide better debug information than would be available through other means. https://bugzilla.gnome.org/show_bug.cgi?id=736557 --- gtk/inspector/widget-tree.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gtk/inspector/widget-tree.c b/gtk/inspector/widget-tree.c index 1de80c859a..a08f04a3e8 100644 --- a/gtk/inspector/widget-tree.c +++ b/gtk/inspector/widget-tree.c @@ -486,11 +486,30 @@ void gtk_inspector_widget_tree_scan (GtkInspectorWidgetTree *wt, GtkWidget *window) { + GtkWidget *inspector_win; + GList *toplevels, *l; + gtk_tree_store_clear (wt->priv->model); g_hash_table_remove_all (wt->priv->iters); gtk_inspector_widget_tree_append_object (wt, G_OBJECT (gtk_settings_get_default ()), NULL, NULL); if (g_application_get_default ()) gtk_inspector_widget_tree_append_object (wt, G_OBJECT (g_application_get_default ()), NULL, NULL); + + inspector_win = gtk_widget_get_toplevel (GTK_WIDGET (wt)); + toplevels = gtk_window_list_toplevels (); + for (l = toplevels; l; l = l->next) + { + if (GTK_IS_WINDOW (l->data) && + gtk_window_get_window_type (l->data) == GTK_WINDOW_TOPLEVEL && + l->data != window && + l->data != inspector_win) + { + g_message ("adding %s", gtk_window_get_title (l->data)); + gtk_inspector_widget_tree_append_object (wt, G_OBJECT (l->data), NULL, NULL); + } + } + g_list_free (toplevels); + gtk_inspector_widget_tree_append_object (wt, G_OBJECT (window), NULL, NULL); gtk_tree_view_columns_autosize (GTK_TREE_VIEW (wt)); -- 2.30.2